package com.hailin.lease.common.utils;

/**
 * @author: yuhailin
 * @description 获取验证码
 * @date: 2024/8/6 17:57
 */

public class CodeUtil {
    public static String getCode(Integer length) {
        StringBuilder code = new StringBuilder();
        for (int i = 0; i < length; i++) {
            int random = (int) (Math.random() * 10);
            code.append(random);
        }
        return code.toString();
    }
}
